package com.gitee.simons.oauth.entity.po;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author JSM
 * @since 2020-07-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="OauthClientDetails对象", description="")
public class OauthClientDetails implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    private String id;

    @ApiModelProperty(value = "客户端id")
    private String clientId;

    @ApiModelProperty(value = "资源idjson字符串")
    private String resourceIds;

    @ApiModelProperty(value = "客户端密码")
    private String clientSecret;

    @ApiModelProperty(value = "权限范围")
    private String scope;

    @ApiModelProperty(value = "指定客户端支持的,支持多个用逗号分割")
    private String authorizedGrantTypes;

    @ApiModelProperty(value = "服务重定向的url")
    private String webServerRedirectUri;

    @ApiModelProperty(value = "指定客户端所拥有的权限值,支持多个用逗号分割")
    private String authorities;

    @ApiModelProperty(value = "设定客户端的access_token的有效时间值(单位:秒)")
    private Integer accessTokenValidity;

    @ApiModelProperty(value = "设定客户端的refresh_token的有效时间值(单位:秒)")
    private Integer refreshTokenValidity;

    @ApiModelProperty(value = "这是一个预留的字段,在Oauth的流程中没有实际的使用,可选,但若设置值,必须是JSON格式的数据")
    private String additionalInformation;

    @ApiModelProperty(value = "设置用户是否自动Approval操作, 默认值为 'false', 可选值包括 'true','false', 'read','write'. 该字段只适用于grant_type为authorization_code的情况,当用户登录成功后,若该值为'true'或支持的scope值,则会跳过用户Approve的页面, 直接授权")
    private String autoapprove;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "设置客户端是否为受信任的,默认为'0'(即不受信任的,1为受信任的). ")
    private Boolean trusted;


}
